package com.info.zhiduoduo.repository.mapper.marketingcooperative;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.info.zhiduoduo.repository.dto.marketingcooperative.MarketingCooperativePosterConfigDto;
import com.info.zhiduoduo.repository.entity.marketingcooperative.MarketingCooperativePosterConfig;

import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MarketingCooperativePosterConfigMapper extends BaseMapper<MarketingCooperativePosterConfig> {

	@Select(" select mcpc.*,c.compname  " +
			" from zdd_marketing_cooperative_poster_config mcpc " +
			" join zdd_company c on c.compid = mcpc.compid " +
			" where mcpc.compid = #{compid}")
	List<MarketingCooperativePosterConfig> listByCompid(Integer compid);

	@Select(" select mcpc.*,c.compname " +
			" from zdd_marketing_cooperative_poster_config mcpc " +
			" join zdd_company c on c.compid = mcpc.compid " +
			" where mcpc.name like '%${configName}%' " +
			" and c.compname like '%${conpname}%' " +
			" order by mcpc.id desc")
	List<MarketingCooperativePosterConfigDto> listByName(String configName, String compname);
}
